<?php

namespace App\Remote\Guanyuan\GuanyuanV3;

use Closure;
use GuzzleHttp\Exception\GuzzleException;

class GuanyuanRemoteV3 extends Remote
{

    /**
     * @param string $uri
     * @param string $requestMethod
     * @param null $params
     * @param array|null $headers
     * @param Closure|null $handleResponseClosure
     * @param int $cacheTime
     * @param bool $throwException
     * @return array|mixed
     * @throws GuzzleException
     */
    public static function guanyuanRemoteV3(
        string $uri,
        string $requestMethod,
        $params = null,
        array $headers = null,
        Closure $handleResponseClosure = null,
        int $cacheTime = 0,
        bool $throwException = false
    ): array
    {
        try {
            return self::customRequestV3($uri, $requestMethod, $params, $headers, $handleResponseClosure, $cacheTime, $throwException);
        } catch (\Exception $exception) {
            logException("观远请求错误V3:", $exception, null, true, true);
            return [];
        }
    }
}
